import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsNumber, IsBoolean, IsOptional, IsUrl } from 'class-validator';

export class CreateCarouselDto {
  @ApiProperty({ description: '走马灯标题' })
  @IsString()
  title: string;

  @ApiProperty({ description: '副标题', required: false })
  @IsString()
  @IsOptional()
  subTitle?: string;

  @ApiProperty({ description: '描述', required: false })
  @IsString()
  @IsOptional()
  description?: string;

  @ApiProperty({ description: '图片URL', required: false })
  @IsString()
  @IsOptional()
  imageUrl?: string;

  @ApiProperty({ description: '背景颜色', required: false })
  @IsString()
  @IsOptional()
  backgroundColor?: string;

  @ApiProperty({ description: '链接URL', required: false })
  @IsString()
  @IsOptional()
  linkUrl?: string;

  @ApiProperty({ description: '状态（激活/未激活）', default: true })
  @IsBoolean()
  @IsOptional()
  status?: boolean = true;

  @ApiProperty({ description: '顺序', default: 0 })
  @IsNumber()
  @IsOptional()
  order?: number = 0;
}

export class UpdateCarouselDto extends CreateCarouselDto {}

export class CarouselResponseDto {
  @ApiProperty({ description: '走马灯ID' })
  id: number;

  @ApiProperty({ description: '走马灯标题' })
  title: string;

  @ApiProperty({ description: '副标题' })
  subTitle: string;

  @ApiProperty({ description: '描述' })
  description: string;

  @ApiProperty({ description: '图片URL' })
  imageUrl: string;

  @ApiProperty({ description: '背景颜色' })
  backgroundColor: string;

  @ApiProperty({ description: '链接URL' })
  linkUrl: string;

  @ApiProperty({ description: '状态（激活/未激活）' })
  status: boolean;

  @ApiProperty({ description: '顺序' })
  order: number;

  @ApiProperty({ description: '创建时间' })
  createdAt: Date;

  @ApiProperty({ description: '更新时间' })
  updatedAt: Date;
} 